<template>
  <div id="app">

    <router-view/>
  </div>
</template>

<script>
import { eventBus } from '@/views/system/InterfaceConfigure/event-bus'
import { getreportandshuiyinapi } from '@/api/system/InterfaceConfigure'
import { getloginuserapi } from '@/api/cycle'
import watermark from 'watermark-dom'
export default {
  async mounted () {
    // this.checkWatermark()
    eventBus.$on('addWatermark', () => {
      this.checkWatermark()
    })
  },
  methods: {
    async checkWatermark () {
      const res = await getloginuserapi()
      const { data: { entity } } = await getreportandshuiyinapi(res.data.entity.manageNo)
      if (+entity.waterMarkFlag) {
        this.isshuiyin(entity)
      } else {
        const { data: { entity } } = await getreportandshuiyinapi(res.data.entity.orgNo)
        if (+entity.waterMarkFlag) {
          this.isshuiyin(entity)
        } else {
          this.isshuiyin({ waterMark: ' ' })
        }
      }
    },
    isshuiyin (val) {
      watermark.watermark.load({ watermark_txt: val.waterMark })
    }
  }
}
</script>
<style lang="scss">
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body, html, #app{
height: 100%;
margin: 0;
background-color:#f1f1f1;
font-size: 16px!important;
box-sizing: border-box;
}
button{
  cursor: pointer;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}
::v-deep ::-webkit-scrollbar {
    display: none;
}
</style>
